<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    let a=1;
    console.log(a)
</script>

<script>


    //在方法内 a是局部变量

   function fn(){
       let a=2;
       console.log(a)
   }

     fn()


</script>

</body>
</html>